[various] Convert example boilerplate from Java to Kotlin#12201
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates various Android example files, including activities and test annotations, from Java to Kotlin across multiple packages, and updates compile options to Java 17 in path_provider_android. The review feedback suggests removing unnecessary empty curly braces from Kotlin classes that do not have a body to improve readability and align with the Kotlin style guide.
| // found in the LICENSE file. | ||
|
|
||
| package io.flutter.plugins.videoplayerexample; | ||
| package dev.flutter.packages.file_selector_android_example |
There was a problem hiding this comment.
Why did this package change from videoplayer to file_selector that seems odd? Is this just a goofy diff?
There was a problem hiding this comment.
Yep, goofy diff. https://github.com/flutter/packages/pull/12201/changes/BASE..7e1682bedb666ae8062250ab7cf4439d0a2b32b4#diff-184008b21da0737a5394630bb058154b375dabd33dc6d857b61c316ad1e222e1 is the reverse. Why the move detection only picked out these two files, and also thinks they swapped places, I have absolutely no idea.
There was a problem hiding this comment.
This file appears to be identical to including the package. Is there a reason we have 2?
https://github.com/stuartmorgan-g/packages/blob/7e1682bedb666ae8062250ab7cf4439d0a2b32b4/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/src/debug/kotlin/io/flutter/plugins/googlemapsexample/GoogleMapsTestActivity.kt
The difference is the top level plugin vs the android plugin.
Converts various example files that are entirely or almost entirely boilerplate from Java to Kotlin. These are manual conversions following very simple mechanical conversion rules, and mostly replicated across a bunch of copies.
Since these are not files that anyone needs to interact with regularly, this seemed in keeping with the current policy of allowing Java for files that are not actively maintained by humans (mostly generated Pigeon code, but also most example app code, and some small utilities for Java/Kotlin Pigeon interop), while also letting us more easily see what code is actually still using Java.
Part of flutter/flutter#188630
Pre-Review Checklist
[shared_preferences]///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2